home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
util3
/
cmpctplr.lha
/
CompactPlayer
/
Source
/
listbrowser.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-12-28
|
840b
|
40 lines
#define __USE_SYSBASE=1
#include <proto/listbrowser.h>
#include <gadgets/listbrowser.h>
#include <proto/exec.h>
#include <exec/memory.h>
struct List *
EditBrowserNodesA( STRPTR *labels )
{
struct TagItem ti[5];
struct List *l;
struct Node *n;
/* allocate a simple 1 column ListBrowser list from a label array */
if (!labels)
return NULL;
if (!(l = AllocMem(sizeof(struct List), MEMF_PUBLIC|MEMF_CLEAR)))
return NULL;
NewList( l );
ti[0].ti_Tag = LBNCA_Text;
ti[1].ti_Tag = LBNCA_CopyText; ti[1].ti_Data = TRUE;
ti[2].ti_Tag = LBNCA_MaxChars; ti[1].ti_Data = 39;
ti[3].ti_Tag = LBNCA_Editable; ti[3].ti_Data = TRUE;
ti[4].ti_Tag = TAG_END;
while (*labels)
{
ti[0].ti_Data = (ULONG)*labels;
if (!(n = AllocListBrowserNodeA( 1, ti )))
break;
n->ln_Name = *labels++;
AddTail( l, n );
}
return l;
}